<template>
	<view class="container">
		<!-- 页面标题 -->
		<view class="page-title">待支付订单</view>
		
		<!-- 订单信息 -->
		<view class="order-info">
			<view class="section-title">
				<text>订单信息</text>
				<view class="status-badge">待支付</view>
			</view>
			<view class="info-item">
				<view class="info-label">订单号：</view>
				<view class="info-value">121212112487878</view>
			</view>
			<view class="info-item">
				<view class="info-label">服务项目：</view>
				<view class="info-value">车辆保养</view>
			</view>
			<view class="info-item">
				<view class="info-label">服务门店：</view>
				<view class="info-value">
					大宝车辆维修店
					<image class="store-icon" src="/static/order/plane.png"></image>
				</view>
			</view>
			<view class="info-item">
				<view class="info-label">下单时间：</view>
				<view class="info-value">2023-03-08 17:40</view>
			</view>
			<view class="info-item">
				<view class="info-label">预约时间：</view>
				<view class="info-value">2023-03-09 17:40</view>
			</view>
			<view class="info-item">
				<view class="info-label">车辆：</view>
				<view class="info-value">奔驰PWE4/豫A98FHJ</view>
			</view>
		</view>
		
		<!-- 分隔线 -->
		<view class="divider"></view>
		
		<!-- 订单详情 -->
		<view class="order-detail">
			<view class="section-title">订单详情</view>
			<view class="detail-item">
				<view class="detail-name">车辆精光</view>
				<view class="detail-price">¥39.90</view>
			</view>
			<view class="detail-item">
				<view class="detail-name">车辆附加费用</view>
				<view class="detail-price">¥0</view>
			</view>
			
			<view class="divider"></view>
			
			<view class="detail-item">
				<view class="detail-name">原价</view>
				<view class="detail-price">¥59.90</view>
			</view>
			<view class="detail-item">
				<view class="detail-name">店家优惠</view>
				<view class="detail-price discount">-¥20</view>
			</view>
			<view class="detail-item">
				<view class="detail-name">优惠券</view>
				<view class="detail-price discount">-¥10</view>
			</view>
			
			<view class="divider"></view>
			
			<view class="detail-item">
				<view class="detail-name">支付金额</view>
				<view class="detail-price total-price">¥29.9</view>
			</view>
		</view>
		
		<!-- 分隔线 -->
		<view class="divider"></view>
		
		<!-- 操作按钮 -->
		<view class="action-buttons">
			<button class="btn btn-service" @click="contactService">
				<image class="btn-icon" src="/static/order/客服.png"></image>
				联系客服
			</button>
			<button class="btn btn-cancel" @click="cancelOrder">取消订单</button>
			<button class="btn btn-pay" @click="goToPayment">立即支付</button>
		</view>
	</view>
</template>

<script>
	export default {
		data() {
			return {};
		},
		methods: {
			contactService() {
				uni.showToast({
					title: '联系客服',
					icon: 'none'
				});
			},
			cancelOrder() {
				uni.showModal({
					title: '取消订单',
					content: '确定要取消此订单吗？',
					success: (res) => {
						if (res.confirm) {
							uni.showToast({
								title: '订单已取消',
								icon: 'none'
							});
							// 实际项目中这里应该有取消订单的API调用
							setTimeout(() => {
								uni.navigateBack();
							}, 1500);
						}
					}
				});
			},
			goToPayment() {
				uni.showToast({
					title: '跳转到支付页面',
					icon: 'none'
				});
				// 实际项目中这里应该跳转到支付页面
			}
		}
	};
</script>

<style>
	.container {
		padding: 0;
		font-size: 14px;
		line-height: 24px;
		background-color: #f5f5f5;
		min-height: 100vh;
	}
	
	.page-title {
		padding: 15px;
		background-color: #fff;
		font-size: 18px;
		font-weight: bold;
		text-align: center;
		border-bottom: 1px solid #eee;
	}
	
	.order-info {
		padding: 15px;
		background: #fff;
		position: relative;
	}
	
	.section-title {
		font-size: 16px;
		font-weight: bold;
		margin-bottom: 15px;
		padding-bottom: 10px;
		border-bottom: 1px solid #f0f0f0;
		display: flex;
		justify-content: space-between;
		align-items: center;
	}
	
	.status-badge {
		font-size: 13px;
		color: #ff3b30;
		font-weight: bold;
		padding: 3px 8px;
		border-radius: 10px;
		background-color: rgba(255, 59, 48, 0.1);
	}
	
	.info-item {
		display: flex;
		margin-bottom: 12px;
	}
	
	.info-label {
		width: 80px;
		color: #666;
		font-size: 14px;
	}
	
	.info-value {
		flex: 1;
		font-size: 14px;
		display: flex;
		align-items: center;
	}
	
	.store-icon {
		width: 16px;
		height: 16px;
		margin-left: 5px;
	}
	
	.order-detail {
		padding: 15px;
		background: #fff;
	}
	
	.detail-item {
		display: flex;
		justify-content: space-between;
		margin-bottom: 12px;
	}
	
	.detail-name {
		color: #333;
		font-size: 14px;
	}
	
	.detail-price {
		color: #333;
		font-size: 14px;
	}
	
	.divider {
		height: 1px;
		background: #f0f0f0;
		margin: 15px 0;
	}
	
	.discount {
		color: #ff9500;
	}
	
	.total-price {
		font-weight: bold;
		font-size: 16px;
	}
	
	.action-buttons {
		padding: 20px 15px;
		background: #fff;
		display: flex;
		justify-content: space-between;
	}
	
	.btn {
		padding: 12px 0;
		border-radius: 20px;
		font-size: 15px;
		text-align: center;
		width: 30%;
		display: flex;
		justify-content: center;
		align-items: center;
	}
	
	.btn-icon {
		width: 16px;
		height: 16px;
		margin-right: 5px;
	}
	
	.btn-service {
		border: 1px solid #ddd;
		background: #fff;
		color: #333;
	}
	
	.btn-cancel {
		background: #999;
		color: #fff;
		border: none;
	}
	
	.btn-pay {
		background: #007aff;
		color: #fff;
		border: none;
	}
</style>